package cn.b.sky.mes.pp.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import cn.b.sky.mes.pp.dao.ProcessPlanRateDao;
import cn.b.sky.mes.pp.model.ProcessPlanRate;
import cn.b.sky.mes.pp.model.condition.ProcessPlanRateCondition;
import org.springframework.stereotype.Service;

import cn.b.sky.mes.pp.service.ProcessPlanRateService;

@Service("processPlanRateService")
public class ProcessPlanRateServiceImpl implements ProcessPlanRateService {

  @Resource
  ProcessPlanRateDao processPlanRateDao;
  
  @Override
  public List<ProcessPlanRate> getProcessPlanRateListByCondition(ProcessPlanRateCondition condition) {
    if (condition == null) {
      return null;
    }
    return processPlanRateDao.selectProcessPlanRateByCondition(condition);
  }

  @Override
  public int getProcessPlanRateCountByCondition(ProcessPlanRateCondition condition) {
    if (condition == null) {
      return 0;
    }
    return processPlanRateDao.selectProcessPlanRateCountByCondition(condition);
  }

  @Override
  public List<Map<String, Object>> getProcessPlanRateExcelByCondition(ProcessPlanRateCondition condition) {
    if (condition == null) {
      return null;
    }
    return processPlanRateDao.selectProcessPlanRateExcelByCondition(condition);
  }

  @Override
  public List<ProcessPlanRate> getProcessPlanRateDetails(ProcessPlanRateCondition condition) {
    if (condition == null) {
      return null;
    }
    return processPlanRateDao.selectProcessPlanRateDetailByCondition(condition);
  }

  @Override
  public int getgetProcessPlanRateDetailsCount(ProcessPlanRateCondition condition) {
    if (condition == null) {
      return 0;
    }
    return processPlanRateDao.selectProcessPlanRateDetailCountByCondition(condition);
  }

}
